import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class Demo {
    public static void main(String[] args) {
        testBcryptPasswordEncoder();
    }
    public static void testBcryptPasswordEncoder(){
        String pwd="123456";
        BCryptPasswordEncoder passwordEncoder1 = new BCryptPasswordEncoder ();
        String encode = passwordEncoder1.encode(pwd);
        System.out.println(encode);
        System.out.println(passwordEncoder1.matches(pwd , encode));
        System.out.println("-------------------------");
        BCryptPasswordEncoder passwordEncoder2 = new BCryptPasswordEncoder(16);
        String encode2 = passwordEncoder2.encode(pwd);
        System.out.println(encode2);
        System.out.println(passwordEncoder2.matches(pwd,encode2));
        }

    }
